{% extends "nomcom/nomcom_private_base.html" %}
{# Copyright The IETF Trust 2015, All Rights Reserved #}
{% load origin %}
{% load django_bootstrap5 %}
{% load ietf_filters person_filters %}
{% block subtitle %}- Send reminder messages{% endblock %}
{% block nomcom_content %}
    {% origin %}
    <h2>Send reminder to {{ reminder_description }}</h2>
    {% if nomcom.group.state_id == 'active' %}
        <p class="mt-3">
            The message that will be sent is as follows:
        </p>
        <pre class="border p-3 my-3">{{ mail_template.content|wordwrap:80 }}</pre>
        {% if mail_template %}
            <p>
                <a class="btn btn-primary"
                   href="{% url 'ietf.nomcom.views.edit_template' year mail_template.id %}">
                    Edit the message
                </a>
            </p>
        {% endif %}
        <p class="mt-3">
            These are the nominees that are in the <b>{{ state_description }}</b> state for the listed positions.
            The message that will be sent is shown below the list of nominees.
        </p>
    {% endif %}
    {% if nomcom.group.state_id == 'active' %}
        <form id="reminderform" method="post">
            {% csrf_token %}
            <table class="table table-sm table-striped">
                <thead>
                    <tr>
                        <th scope="col">
                            <i class="bi bi-check"></i>
                        </th>
                        <th scope="col" data-sort="nominee">Nominee</th>
                        <th scope="col" data-sort="positions">Positions</th>
                    </tr>
                </thead>
                <tbody>
                    <!-- [html-validate-disable-block input-missing-label -- labelled via aria-label] -->
                    {% for nominee in nominees %}
                        <tr>
                            <td>
                                <input type="checkbox"
                                       class="batch-select form-check-input"
                                       id="id-{{ nominee.id }}"
                                       aria-label="{{ nominee.name }}"
                                       value="{{ nominee.id }}"
                                       name="selected"
                                       checked>
                            </td>
                            <td>{% person_link nominee.person %}</td>
                            <td>{{ nominee.interesting_positions|join:", " }}</td>
                        </tr>
                    {% endfor %}
                </tbody>
            </table>
            <button class="btn btn-primary"
                   type="submit"
                   name="submit">
                Submit request
            </button>
        </form>
    {% endif %}
{% endblock %}